import request from '@/utils/request'

export function getRoutes() {
  return request({
    url: '/vue-element-admin/routes',
    method: 'get'
  })
}
export function getMedicinesByName(data) {
  return request({
    url: '/medicineBase/queryListByName',
    method: 'get',
    params: data
  })
}

export function getMedicines(data) {
  return request({
    url: '/medicineBase/queryList',
    method: 'get',
    params: data
  })
}

export function addMedicine(data) {
  return request({
    url: '/medicineBase/save',
    method: 'post',
    data
  })
}

export function updateMedicine(data) {
  return request({
    url: '/medicineBase/updateById',
    method: 'post',
    data
  })
}

export function deleteMedicine(id) {
  return request({
    url: `/vue-element-admin/Medicine/${id}`,
    method: 'delete'
  })
}
export function medicineCheckInOut(data) { // 药品出库入库
  return request({
    url: '/medicineCheckInOut/save',
    method: 'post',
    data
  })
}

export function getMedicineCheckInOutList(data) { // 药品出库入库
  return request({
    url: '/medicineCheckInOut/queryList',
    method: 'get',
    params: data
  })
}

export function getLowerWarning(data) { // 报警下限
  return request({
    url: '/medicineBase/queryLowerWarning',
    method: 'get',
    params: data
  })
}

export function queryUpperWarning(data) { // 报警上限
  return request({
    url: '/medicineBase/queryUpperWarning',
    method: 'get',
    params: data
  })
}

export function getReturn(data) {
  return request({
    url: '/returnBase/queryByPage',
    method: 'get',
    params: data
  })
}

export function getReturnById(data) {
  return request({
    url: '/returnBase/queryById',
    method: 'get',
    params: data
  })
}
export function getMedicineReturnById(data) {
  return request({
    url: '/medicineReturn/queryPage',
    method: 'get',
    params: data
  })
}



